<?php

/**
 * Created by PhpStorm.
 * User: leileisun
 * Date: 2018-12-31
 * Time: 16:30
 */

function route_class() {
    return str_replace('.','-',Route::currentRouteName());
}

function html2txt($html) {
    $result = htmlspecialchars_decode($html);//把一些预定义的 HTML 实体转换为字符
    $result = str_replace("&nbsp;","",$result);//将空格替换成空
    $result = str_replace(" ","",$result);//将空格替换成空
    $result = strip_tags($result);//函数剥去字符串中的 HTML、XML 以及 PHP 的标签,获取纯文本内容
    $result = mb_substr($result, 0, 300,"utf-8");//返回字符串中的前100字符串长度的字符
    return $result;
}
